<template>
  <div>
    A
    {{ list }}
  </div>
</template>
<script>
const createData = () => {
  return new Promise((resolve, reject) => {
    resolve({
      code: 0,
      msg: 'success',
      list: ['测试数据'],
    })
  })
}
export default {
  data() {
    return {
      list: [],
    }
  },
  activated() {
    console.log('缓存组件的触发-activated')
  },
  async created() {
    const data = await createData()
    console.log('data:', data)
    this.list = data.list
  },
  mounted() {
    console.log('mounted----a')
  },
  deactivated() {
    console.log('缓存组件的卸载-deactivated')
  },
}
</script>
